using System;
using System.Windows.Forms;

namespace Fcdbas.Core.Windows
{
	public class WindowActionsEventArgs : System.EventArgs
	{
		public new static readonly WindowActionsEventArgs Empty = new WindowActionsEventArgs(System.IntPtr.Zero, 0, System.IntPtr.Zero, System.IntPtr.Zero);
		private int m_msg;
		private object m_wParam;
		private object m_lParam;
		private System.IntPtr m_hwnd;
		private bool m_handled;
		private bool m_returnSet;
		private SalNumber m_returnValue;
		public SalNumber Return
		{
			get
			{
				return this.m_returnValue;
			}
			set
			{
				if (System.IntPtr.Size == 4)
				{
					int x = value.ToInt32();
					this.m_handled = true;
					this.m_returnSet = true;
					this.m_returnValue = x;
					return;
				}
				long x2 = value.ToInt64();
				this.m_handled = true;
				this.m_returnSet = true;
				this.m_returnValue = x2;
			}
		}
		public bool HasReturnValue
		{
			get
			{
				return this.m_returnSet;
			}
		}
		public bool Handled
		{
			get
			{
				return this.m_handled;
			}
			set
			{
				this.m_handled = value;
			}
		}
		public object WParam
		{
			get
			{
				return this.m_wParam;
			}
			set
			{
				this.m_wParam = value;
			}
		}
		public object LParam
		{
			get
			{
				return this.m_lParam;
			}
			set
			{
				this.m_lParam = value;
			}
		}
		public int ActionType
		{
			get
			{
				return this.m_msg;
			}
			set
			{
				this.m_msg = value;
			}
		}
		public SalWindowHandle hWnd
		{
			get
			{
				return this.m_hwnd;
			}
		}
		
		
		internal WindowActionsEventArgs(System.Windows.Forms.Message m) : this(m.HWnd, m.Msg, m.WParam, m.LParam)
		{
		}
        public WindowActionsEventArgs(System.Windows.Forms.Control ctrl, int msg, object wParam, object lParam)
            : this(ctrl.IsHandleCreated ? ctrl.Handle : System.IntPtr.Zero, msg, wParam, lParam)
		{
		}
		public WindowActionsEventArgs(System.IntPtr hWnd, int msg, object wParam, object lParam)
		{
			this.m_msg = msg;
			this.m_hwnd = hWnd;
			this.m_wParam = wParam;
			this.m_lParam = lParam;
			this.m_handled = false;
			this.m_returnSet = false;
			this.m_returnValue = 0;
		}
	}
}
